<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script type="text/javascript" src="./js/promise.js" ></script>
    <script type="text/javascript" >
     let p=new Promise((resolve,reject)=>{
        //setTimeout(() => {
            resolve("自定义then方法")
        //}, 1000);
     })
    const res=p.then(result=>{
        return "ccc"
    },reason=>{
        return "ddd"
    })

    console.log(res)
    /* p.then(result=>{
       alert("aaaa")
    },reason=>{
        alert("cccc")
    }) */


    </script>
</body>
</html>